package com.mantru.iotpot.eventbus;

import java.io.*;
import java.util.*;


public class EventMessage
{
    //定义已占用的id
    public static int MSG_ID_LoginResult = 1000;       //登录界面的结果，收到的message={"result":true}
    public static int MSG_ID_InitProgress = 1001;      //初始化界面的进度值，收到的message={"progress":10}
    public static int MSG_ID_DownApkProgress = 1002;   //下载apk安装包的进度值，收到的message={"progress":10}
    public static int MSG_ID_InstallAPK = 1003;        //安装apk，收到的message={"apk_path":"xxxx"}
    public static int MSG_ID_CleaningTishi = 1004;     //通知首页弹Dialog提示需要清洗料管，收到的message={"name":"[生抽]、[盐水]"}
    public static int MsgID_CheckSelf_Timeout = 1005;  //自检超时，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset0 = 1006;   //手动自检的机械臂复位通知，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset1 = 1007;   //手动自检的锅口复位通知，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset2 = 1008;   //手动自检的投菜复位通知，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset3 = 1009;   //手动自检的平移复位通知，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset4 = 1010;   //手动自检的机械爪复位成功通知，收到的message=空字符串
    public static int MsgID_CheckSelf_Reset5 = 1011;   //手动自检的机械爪复位超时通知，收到的message=空字符串
    public static int MSG_ID_ErrorInfo = 2001;         //故障，收到的message={"error_code":"xxxx","error_desc":"xxxx","error_data":"xxxx","error_type":1}
    public static int MSG_ID_ErrorGripper = 2002;      //炒菜爪开关状态失效，收到message=空字符串
    public static int MSG_ID_TTSSpeak = 4001;          //TTS播音，收到的message={"text":"xxxx"}
    public static int MSG_ID_OnTrigger = 5001;         //触发器事件，收到的message={"data":"xxxx"}
    public static int MSG_ID_OnGripperChange = 6001;   //机械臂的位置发生了变化事件，收到的message={"old_value":1,"new_value":0}
    public static int MSG_ID_OnGripperMoving = 6002;   //机械臂在运动中事件，收到的message={"old_value":1,"new_value":0}
    public static int MSG_ID_OnPotChange = 6003;       //锅的位置发生了变化事件，收到的message={"old_value":1,"new_value":0}
    public static int MSG_ID_OnPotMoving = 6004;       //锅在运动中事件，收到的message={"old_value":1}
    public static int MSG_ID_OnHttpData_APP = 6005;    //获取app是否有新版本的http get请求
    public static int MSG_ID_OnHttpData_IAP = 6006;    //获取iap是否有新版本的http get请求
    public static int MSG_ID_OnHttpData_Image = 6007;  //获取共享图片的http get请求
    public static int MSG_ID_IAP_InstallProgress = 7001;    //IAP安装包的安装进度值，收到的message={"max_value":300,"cur_value":10}
    public static int MSG_ID_IAP_InstallFinish = 7002;      //IAP安装完毕
    public static int MSG_ID_IAP_InstallError = 7003;       //IAP安装失败，收到的message={"error":"内存不足"}
    public static int MSG_ID_OnSyncVegetable = 8001;        //推送菜谱，收到的message={"msg":"远程同步更新了10个菜谱"}

    public int id;
    public String message;

    public EventMessage(int id, String message)
    {
        this.id = id;
        this.message = message;
    }

    @Override
    public String toString() {
        return "{\"id\":" + id + ",\"message\":\"" + message + "\"}";
    }
}
